<template>
  <var-pull-refresh v-model="isRefresh" @refresh="refresh">
    <waterHomeFall :listData="state.homeList" :is-del="false"></waterHomeFall>
  </var-pull-refresh>
  <common-tabbar :index="tabbarActive" />
</template>

<script setup lang="ts">
import waterHomeFall from "@/components/water-home-fall.vue";
import { getPhotoAll } from "@/api/usersApi";
import { onMounted, reactive, ref } from "vue";
const tabbarActive = ref(0);
const isRefresh = ref(false);
const state = reactive({
  homeList: [],
});
import useCommonhooks from "@/hooks/commonHooks/useCommonhooks";
const { documentTitle } = useCommonhooks();

const fetchData = async () => {
  try {
    const { data, code, message } = await getPhotoAll();
    state.homeList = data;
  } catch (e) {}
};
const refresh = async () => {
  await fetchData();
  isRefresh.value = false;
};
onMounted(async () => {
  await fetchData();
});
documentTitle("首页");
</script>

<style scoped></style>
